package entity.transformer;

import json.JSONException;
import entity.Position;
import entity.map.FieldEntity;
import entity.map.FieldEntityMap;

public class TransformerMap
{

	/**
	 * @param args
	 * @throws JSONException 
	 */
	public static void main(String[] args) throws JSONException
	{
		FieldEntityMap map = new FieldEntityMap(20,20);
		for(int i =1; i <20;i++ )
		{
			for(int j =1; j <20;j++ )
			{
				map.setFieldEntity(new FieldEntity(new Position(i,j)));
			}
		}
		
		String stringMap = new FieldEntityMapTransformer().getJSON(map);
		System.out.print(stringMap);
		FieldEntityMap map2 = new FieldEntityMapTransformer().getJSON(stringMap);
		for(int i =1; i <20;i++ )
		{
			for(int j =1; j <20;j++ )
			{
				System.out.println(map2.getFieldEntity(new Position(i,j)));
			}
		}
	}

}
